package com.bdq.interaction.infrastructure.persistence.mysql.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.bdq.common.enums.InteractionTypeEnum;
import com.bdq.interaction.infrastructure.persistence.mysql.pojo.InteractionSingle;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author malei
* @description 针对表【interaction_single(交互单一表)】的数据库操作Service
* @createDate 2024-05-14 15:04:13
*/
public interface InteractionSingleService extends IService<InteractionSingle> {

    /**
     * 取消点赞
     *
     * @param contentId
     * @param userId
     * @return
     */
    Boolean cancelLike(Long contentId, Long userId);

    /**
     * 取消收藏
     *
     * @param contentId
     * @param userId
     * @return
     */
    Boolean cancelCollect(Long contentId, Long userId);

    /**
     * 获取交互数据
     *
     * @param userId
     * @param contentId
     * @return
     */
    List<InteractionSingle> getData(Long userId, Long contentId);

    /**
     * 获取交互数据
     *
     * @param userId
     * @param contentId
     * @param type
     * @return
     */
    InteractionSingle getData(Long userId, Long contentId, InteractionTypeEnum type);

    /**
     * 分页查询报名用户
     *
     * @param contentId
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<InteractionSingle> pageSignUp(Long contentId, Integer pageNo, Integer pageSize);

    /**
     * 列表查询
     *
     * @param userId
     * @param contentIds
     * @return
     */
    List<InteractionSingle> listData(Long userId, List<Long> contentIds);

    /**
     * 分页查询用户交互数据
     *
     * @param userId
     * @param type
     * @param pageNo
     * @param pageSize
     * @return
     */
    IPage<InteractionSingle> page(Long userId, Long type, Integer pageNo, Integer pageSize);
}
